<?
switch ($_REQUEST['frame']){

	case "product" :

		$cat = 0;

		if ($_REQUEST['cat']!= '') $cat = killInjection($_REQUEST['cat']);

		$catInfo = getRecord("tbl_product_category","id=".$cat);

		$parent = getRecord("tbl_product_category","id=".$catInfo['parent']);
        
        if($parent['id'] != 2) {
            $strLinkFriendly = unicodeToNonUnicode($parent['name']);
            $title_parent = '<a href="/khohangtot">Kho hàng tốt</a>'."&nbsp;»&nbsp;".'<a href="/khohangtot/list-product/'.$parent['id'].'/'.$strLinkFriendly.'.htm">'.$parent['name'].'</a>';
        } else {
            $title_parent = '<a href="/khohangtot">'.$parent['name'].'</a>';
        }
        $strLinkFriendly = unicodeToNonUnicode($catInfo['name']);
        $title_child = '<a href="/khohangtot/list-product/'.$catInfo['id'].'/'.$strLinkFriendly.'.htm">'.$catInfo['name'].'</a>';
		 
        $title = $title_parent."&nbsp;»&nbsp;".$title_child;
		break;

	case "product_detail"  :

		$cat = 0;

		if ($_REQUEST['id']!= '') $cat = killInjection($_REQUEST['id']);

		$product= getRecord("tbl_product","id=".$cat);

		$catInfo = getRecord("tbl_product_category","id=".$product["parent"]);

		$parent = getRecord("tbl_product_category","id=".$catInfo['parent']);
        
        $parent_parent = getRecord("tbl_product_category","id=".$parent['parent']);
        
        if($parent_parent['id'] != 2) {
            $strLinkFriendly = unicodeToNonUnicode($parent_parent['name']);
            $title_parent_pa = '<a href="/khohangtot">Kho hàng tốt</a>'."&nbsp;»&nbsp;".'<a href="/khohangtot/list-product/'.$parent_parent['id'].'/'.$strLinkFriendly.'.htm">'.$parent_parent['name'].'</a>';
        } else {
            $title_parent_pa = '<a href="/khohangtot">'.$parent_parent['name'].'</a>';
        }
        
        $strLinkFriendly = unicodeToNonUnicode($parent['name']);
        $title_pa = '<a href="/khohangtot/list-product/'.$parent['id'].'/'.$strLinkFriendly.'.htm">'.$parent['name'].'</a>';
        
        $strLinkFriendly = unicodeToNonUnicode($catInfo['name']);
        $title_child = '<a href="/khohangtot/list-product/'.$catInfo['id'].'/'.$strLinkFriendly.'.htm">'.$catInfo['name'].'</a>';
        
		$title = $title_parent_pa."&nbsp;»&nbsp;".$title_pa."&nbsp;»&nbsp;".$title_child;
		break;

	case "contact"         : $title = $_lang=="vn" ? "Liên hệ" : "Contact";	break;

	case "intro"           : $title = $_lang=="vn" ? "Giới thiệu" : "About us";break;

	case "service"         : $title = $_lang=="vn" ? "Dịch vụ" : "Service";break;

	case "solution"        : $title = $_lang=="vn" ? "Giải pháp" : "Service";break;

    case "partner"         : $title = $_lang=="vn" ? "Đối tác - Đại lý" : "Partner";break;

	case "encourage"       : $title = $_lang=="vn" ? "Thông tin khuyến mãi" : "Encourage";break;

	case "recruit_detail"  : $title = $_lang=="vn" ? "Thông tin tuyển dụng" : "Recruit";break;

	case "news_detail"     : $title = $_lang=="vn" ? "Chi tiết tin tức và sự kiện" : "News & Event datail";break;

	case "download"        : $title = $_lang=="vn" ? "Tải tài liệu" : "Download";break;

	case "friend"          : $title = $_lang=="vn" ? "Giới thiệu sản phẩm đến bạn bè" : "";break;
	
	case "linkdemo"        : $title = $_lang=="vn" ? "Xem demo thiết bị" : "";break;

	case "finish"          : $title = $_lang=="vn" ? "Hoàn tất mua hàng" : "";break;	

	case "cart"            : $title = $_lang=="vn" ? "Giỏ hàng" : "Cart";break;

	case "checkout"        : $title = $_lang=="vn" ? "Đơn hàng" : "Order form";break;

	case "search"          : $title = $_lang=="vn" ? "Kết quả tìm kiếm" : "Search";break;

	case "registry"        : $title = $_lang=="vn" ? "Đăng ký thành viên" : "Registry";break;

	case "member"          : $title = $_lang=="vn" ? "Thành viên" : "Login";break;

	case "login"           : $title = $_lang=="vn" ? "Thành viên" : "Login";break;

	case "forgotpass"      : $title = $_lang=="vn" ? "Quên mật khẩu" : "Forgot password";break;
	 
	case "home"            : $title = $_lang=="vn" ? "Trang chủ" : "Home";break;

	default                : $title = $_lang=="vn" ? "Trang chủ" : "Home";break;

}
echo $title;
?>